<template>
  <div class="container">
    <!-- <h2 :class="['类名1', '类名2']">组件的样式问题</h2> -->
    <!-- <h2 :class="['abc', flag ? 'thin' : '']">组件的样式问题</h2> -->
    <h2 :class="{ abc: true, thin: flag }">组件的样式问题</h2>
    <button @click="flag = !flag">切换类名</button>
    <p :style="{ padding: '20px', fontSize: '20px' }">这是app中的p</p>
    <goods-list></goods-list>
  </div>
</template>

<script>
import GoodsList from "./components/GoodsList.vue";
export default {
  components: { GoodsList },
  data() {
    return {
      flag: true,
    };
  },
};
</script>

<style lang="less" scoped>
// scoped让两个页面的样式各自生效
.container {
  background-color: aliceblue;
  h2 {
    font-size: 24px;
  }
}
p {
  color: green;
}
.abc {
  color: blue;
}
.thin {
  font-weight: 200;
}
</style>